package com.quotes;

import org.apache.log4j.*;
import com.quotes.datamodell.*;
import com.quotes.io.DerbyAdapter;
import com.quotes.simulation.MassSimulator;
import com.quotes.ui.*;

public class Main 
{
	public static void massiveSimulate() {
		MassSimulator simulator = new MassSimulator();
		simulator.addToSimulation("singlePositionAllowedRisk", new double[]{0.004, 0.005});
		simulator.addToSimulation("considerAtrForStopLossPrice", new boolean[] {true, false});
		simulator.addToSimulation("stopLossPriceFactor", new double[] {0.9, 1});
		simulator.addToSimulation("adx.buy.boundary.lower", new double[]{25});
		simulator.addToSimulation("adx.sell.boundary.lower", new double[]{30});
		simulator.addToSimulation("rsi.buy.boundary.lower", new double[]{25,30,35});
		simulator.addToSimulation("macd.ticks", new String[]{"12-26-9", "13-39-9"});
		simulator.addToSimulation("adx.ticks", new int[]{14,16,18,20,22});
		simulator.simulate();
	}
	
	public static void main(String[] args) {
		BasicConfigurator.configure();
		System.setProperty("http.proxyHost", "proxy.rwe.com");
		System.setProperty("http.proxyPort", "8080");
		
		//massiveSimulate();

		DataRepository repository = new DataRepository();
		repository.tryLoadFromDb();
		Parameters parameters = Configuration.getDefaultParameters();

		try 
		{
			DerbyAdapter derby = new DerbyAdapter();
			MainWindow window = new MainWindow(repository, parameters);
			window.pack();
			window.setVisible(true);
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}
